const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const InterviewSchema = new mongoose.Schema({
  //文件名
  fileName: {
    type: String,
    require: [true, "you must tell us filename"],
  },
  //类型
  type: {
    type: String,
    enum: [
      "市级访谈",
      "县级访谈",
      "镇级访谈",
      "村级访谈",
      "对接会讲话",
      "安置点访谈",
    ],
    require: [true, "you must tell us type"],
  },
  //省key
  provincekey: {
    type: String,
  },
  //市key
  citykey: {
    type: String,
  },
  //区key
  areakey: {
    type: String,
  },
  //省
  province: {
    type: String,
  },
  //市
  city: {
    type: String,
  },
  //区
  area: {
    type: String,
  },
  //具体地址
  address: {
    type: String,
  },
  //维度
  latitude: {
    type: String,
  },
  //经度
  longitude: {
    type: String,
  },
  //市级领导
  municipalLeaders: {
    type: Number,
    default: 0,
  },
  //市级行业部门
  municipalDepartment: {
    type: Number,
    default: 0,
  },
  //县级领导
  countyLeaders: {
    type: Number,
    default: 0,
  },
  //县级行业部门
  countyDepartment: {
    type: Number,
    default: 0,
  },
  //乡镇干部
  townshipLeaders: {
    type: Number,
    default: 0,
  },
  //村干部
  villageCadres: {
    type: Number,
    default: 0,
  },
  //村医、小学校长
  villageDoctorsAndPrincipals: {
    type: Number,
    default: 0,
  },
  //第一书记或驻村工作队
  firstSecretary: {
    type: Number,
    default: 0,
  },
  //人大代表和政协委员
  NPCdeputies: {
    type: Number,
    default: 0,
  },
  //访谈图片
  interviewImageList: {
    type: Array,
    default: [],
  },
  //访谈音频
  interviewAudioList: {
    type: Array,
    default: [],
  },
  //访谈视频
  interviewVideoList: {
    type: Array,
    default: [],
  },
  //日期
  date: {
    type: String,
    require: [true, "you must tell us date"],
  },
  //时间
  time: {
    type: String,
    require: [true, "you must tell us time"],
  },
  publisher: {
    type: Schema.Types.ObjectId,
    ref: "User",
    required: [true, "you must tell us your user_id of interview"],
  },
});

const Interview = mongoose.model("Interview", InterviewSchema);
module.exports = Interview;
